import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class test10 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(); // 数组个数
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextInt();
        }
        System.out.println(majorityElement(nums));
    }
    public static int majorityElement(int[] nums) {
        double flag = (double) nums.length /2; //半数
        int result = 0;
        HashMap<Integer,Integer> hashMap = new HashMap<>(); // 数字,出现次数
        for (int i = 0; i < nums.length; i++) {
            if(!hashMap.containsKey(nums[i]))
                hashMap.put(nums[i],1);
            else
                hashMap.put(nums[i],hashMap.get(nums[i])+1);
        }
        for(Map.Entry<Integer,Integer> entry:hashMap.entrySet()){
            if (entry.getValue()>flag){
                result= entry.getKey();
                break;
            }
        }
        return result;
    }
}
